Skip to content

Match FPM status pool's expose_php with parent #9514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Match FPM status pool's expose_php with parent #9514

wants to merge 2 commits into from

Conversation

dwxh
Copy link
Contributor

@dwxh dwxh commented Sep 8, 2022

If an installed php.ini turns expose_php on/off, and an FPM pool overrides that with php_flag[expose_php]=off/on, a status pool created with pm.status_listen in a pool config will have its expose_php reflect the php.ini value, and not the pool config's override.

This change looks for an override set in
php_flag/php_value/php_admin_flag/php_admin_value and carries that through.

Notably, when coupled with #9508, this fixes sapi/fpm/tests/status-listen.phpt which currently fails if a php.ini is installed with expose_php=off.

@dwxh
Copy link
Contributor Author

dwxh commented Sep 8, 2022

I'm not confident that this is the best way to achieve this, or if the created zvals should be freed at some point - would greatly appreciate someone who knows what they're doing reviewing the change, and perhaps offering advice.

@devnexen devnexen requested a review from bukka September 8, 2022 17:24
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be also good to add a separate test for this. It should be pretty much just adding that value in a new test which would be sort of a copy of the status listen test. It will require explicit check of that X-Powered-By header. We could also think about providing separate php.ini to executed fpm binary but that might not be required for this PR.

@dwxh
Copy link
Contributor Author

dwxh commented Sep 30, 2022

Have added a test, too - more complicated than hoped as there are four different possible instances of expose_php being set:

  • the value set by --INI-- in the test header
  • the value returned by ini_get('expose_php') (which ignores the value set by the above, even if called directly in the test)
  • the value in the FPM pool
  • the value in the FPM status pool

@dwxh dwxh requested a review from bukka September 30, 2022 17:09
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good - just some comments on tests...

@bukka
Copy link
Member

bukka commented Sep 30, 2022

There are also some conflicts looks like so you might need to rebase this. I recommend to first squash it to a single commit and then rebase.

If an installed php.ini turns expose_php on/off, and an FPM pool
overrides that with php_flag[expose_php]=off/on, a status pool
created with pm.status_listen in a pool config will have its expose_php
reflect the php.ini value, and not the pool config's override.

This change looks for an override set in
php_flag/php_value/php_admin_flag/php_admin_value and carries that
through.
@dwxh
Copy link
Contributor Author

dwxh commented Sep 30, 2022

Thanks @bukka - have now done that.

@bukka
Copy link
Member

bukka commented Oct 30, 2022

Merged via e4a1b80

@bukka bukka closed this Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants